Skip to content

Fix English money minor-unit readings and thousand default - #407

Merged
pengzhendong merged 1 commit into
masterfrom
fix/english-money-cents-406
Dec 3, 2026
Merged

pengzhendong merged 1 commit into
masterfrom
fix/english-money-cents-406

Conversation

@pengzhendong

Copy link
Copy Markdown
Member

English TN currently reads $18.50 as “eighteen point five dollars” and 1,022 as “thousand and twenty two”. This change reads one- and two-digit currency fractions as minor units, producing “eighteen dollars fifty cents” and handling singular units such as “one dollar one cent”. It uses the existing dollar, euro, and pound unit tables; quantity expressions, higher-precision fractions, and currencies without minor-unit mappings retain decimal readings.

Prefer “one thousand” over the shortened “thousand” alternative while preserving that alternative for n-best output. Raw money fields remain unchanged, including mapping behavior.

Regression coverage includes the issue examples, singular/plural units, zero and whole amounts, one-digit fractions, other currencies, decimal fallbacks, sentence context, mappings, and n-best candidates.

Validation: python -m pytest tn/english/test -q --disable-warnings — 211 passed on macOS arm64 with Python 3.12.16 and pynini 2.1.7. Fatal flake8 checks (E9,F63,F7,F82) and git diff --check passed.

Fixes #406

@pengzhendong
pengzhendong merged commit 03dd854 into master Dec 3, 2026
1 check failed
@pengzhendong
pengzhendong deleted the fix/english-money-cents-406 branch December 3, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

English TN reads money with cents as a decimal: "$18.50" -> "eighteen point five dollars"

1 participant